<?php
class Api_Row_Category extends Zend_Db_Table_Row_Abstract
{
    public function init()
    {
        if (( int )$this->parent_id !== 0) {
            unset ($this->_data ['descript'], $this->_data ['img_src']);
        }
    }

    public function getUrl($reset = true, $encode = true)
    {
        return Zend_Controller_Front::getInstance()->getRouter()->assemble(array("controller" => "productlist", "action" => "index", $this->parent_id == 0
                                                    ? "category" : "sub_category" => $this->id), null, $reset, $encode);
    }

    //	public function getMidleImg() { return '/image/category/midle/'.$this->img_src.'.jpg'; }
    public function getSmallImg()
    {
        return '/image/category/small/' . $this->img_src . '.jpg';
    }

    public function getBigImg()
    {
        return '/image/category/big/' . $this->img_src . '.jpg';
    }
}